package com.example.design.ddd.practice2.domain.order.event;

import com.example.design.ddd.practice2.common.DomainEvent;
import com.example.design.ddd.practice2.domain.order.valueobject.Money;

import java.time.LocalDateTime;

/**
 * 订单支付事件
 */
public class OrderPaidEvent extends DomainEvent {
    private final String orderId;
    private final Money paidAmount;
    private final LocalDateTime paidTime;

    public OrderPaidEvent(String orderId, Money paidAmount) {
        super(); // 自动生成事件ID和时间戳
        this.orderId = orderId;
        this.paidAmount = paidAmount;
        this.paidTime = LocalDateTime.now();
    }

    // 领域事件应包含足够的信息供其他领域处理
    public String getOrderId() {
        return orderId;
    }

    public Money getPaidAmount() {
        return paidAmount;
    }

    public LocalDateTime getPaidTime() {
        return paidTime;
    }
}